package legumes.shared.domain;

import java.io.Serializable;

import com.googlecode.objectify.annotation.Subclass;

@Subclass
public class HomePlaceDelivery extends PlaceDelivery implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int radiusKm;
	
	public HomePlaceDelivery() {
		super();
	}

	@Override
	public String toString() {
		return super.toString() + " - radius=" + getRadiusKm();
	}

	public int getRadiusKm() {
		return radiusKm;
	}

	public void setRadiusKm(int radiusKm) {
		this.radiusKm = radiusKm;
	}

	public boolean canDeliverPointAdress(LatLng pointAdress_){
		return pointAdress_.computeDistance(getLatLng()) <= radiusKm;
	}
}
